package org.ak47.spring.boot.grpc;


import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.Map;


/**
 * grpc 通道集合配置
 *
 * @author hexiaohong
 */
@Data
@ConfigurationProperties("ak47.grpc")
public class GrpcChannelsProperties
{

    private Map<String, GrpcChannelProperties> client = new HashMap<>();

    public GrpcChannelProperties getChannel(String name)
    {
        return client.getOrDefault(name, GrpcChannelProperties.DEFAULT);
    }
}